home *** CD-ROM | disk | FTP | other *** search
- /* Hippo Graphic View by Paul Kunz June 1991
- * a subclass of GraphicView in /NextDeveloper/Examples/Draw
- * to add or over-ride so that it can handle hippo Graphic objects
- *
- * Copyright (C) 1991 The Board of Trustees of
- * The Leland Stanford Junior University. All Rights Reserved.
- */
-
- #define HGRAPHICVIEW_H_ID "$Id: HGraphicView.h,v 1.41 1992/04/19 04:13:33 pfkeb Rel $"
-
- #import "GraphicView.h"
-
- #import "hippo.h"
-
- @interface HGraphicView : GraphicView
- {
- id prefPanel; /* the Preferences Panel */
- id prefForm; /* Preferences Panel Form */
- id hDraw; /* global drawing controler object */
- id tupleList; /* List used for archiving & closing */
- id plotList; /* List of Plot objects */
- id cutList; /* List of Plot objects that display Cuts */
- display *dispList; /* list of displays */
- }
- /* The following methods over-ride the super class */
- + initialize;
- /*
- * Registers the defaults
- */
-
- + convert:(NXTypedStream *)ts to:(const char *)type using:(SEL)writer toPasteboard:pb;
- /*
- * over ride method from super class inorder to make this class
- * a scrapper
- */
-
- - initFrame:(const NXRect *)frameRect;
- /*
- * Designated initializer for class.
- */
-
- - (BOOL)validateCommand:menuCell;
- /*
- * Invoked with menuCell by autoupdate mechanism. Returns YES
- * if menuCell's action is valid for selected Graphic(s).
- */
-
- - delete:sender;
- /*
- * Delete selected Graphic objects, but check if any are Plot objects
- * displaying a cut. If so, prompt user first.
- */
-
- - cut:sender;
- /*
- * Cut selected Graphic objects, but check if any are Plot objects
- * displaying a cut. If so, prompt user first.
- */
-
- - (BOOL) isAllowed;
- /* A private method to support cut: and delete: methods.
- * Checks if any selected graphic is a cutPlot. Returns
- * YES if cut: or delete: method can proceed
- */
-
- /* The following methods are extensions for Hippo */
- - addPlotOfType:(int) type;
- /*
- * Creates and adds a new Plot of specified type to the GraphicView,
- * selects it and returns the newly created plot.
- * The type corresponds to the hippo graphtype_t
- *
- * See also: -addPlotOfType:andSelect:
- */
-
- - addPlotOfType:(int) type andSelect:(BOOL) selFlag;
- /*
- * Creates and adds a new Plot of specified type to the GraphicView
- * and returns the newly created plot.
- * The type corresponds to the hippo graphtype_t
- * If selFlag is YES then
- * also selects the newly created plot and brings front the
- * data selection inspector.
- *
- * See also: -addPlotOfType:
- */
-
- - hTupleForFile:(const char *)filename index:(int) iValue;
- /*
- * Returns the HTuple object that contains the iValue-th ntuple in
- * file filename, or nil if none found.
- */
-
- - setTuple:(ntuple) nt withNewDisplay:(int) dim;
- /*
- * Creates a new Plot graphic and display with dimension dim with
- * tuple nt, and inserts it into the view.
- */
-
- - addCut:plot;
- /*
- * Adds the Plot plot to the Cut Plot list. Used with pasting a
- * cut plot.
- */
-
- - placeDisplay:(id) plot select:(int) sel;
- /*
- * given a new plot, put it on the page in a reasonable place.
- * resize the document only by page steps.
- * if sel is true, select the plot; otherwise don't.
- */
-
- - addPage:sender;
- /*
- * extend the document by 1 page and move all the objects up.
- */
-
- - saveAsExportFile:(const char *)filename;
- /*
- * Saves all displays and ntuples as the export file filename. That is,
- * save them as a pure Hippo file and ignore and additional graphic
- * objects.
- */
-
- - (display *) displayList;
- /*
- * returns a NULL terminated list of hippo displays that were collected
- * during archiving the view.
- */
-
- - plotList;
- /*
- * Returns a List object that contains all Plot objects in the view.
- */
-
- - cutList;
- /*
- * Returns a List object that contains Plot objects which support
- * displays of Cuts.
- */
-
- - firstPlot;
- /*
- * Returns the Plot object is only one is selected or
- * returns the first Plot of a Overlay group, if only one is selected.
- */
-
- - reDrawPlot;
- /* reDraws the plots. Temporary method until each plot modification
- * method is implemented as graphicPerform style method.
- */
-
- - graphicsPerformNOP: g;
- /*
- * caches extended bounds of single graphic g
- */
-
- - graphicsPerform:(SEL)aSelector with:(void *)argument
- andDraw:(BOOL)flag inList:aList;
- /*
- * Sends message aSelector with argument argument to graphic objects
- * in List aList. If flag is YES, redraws the graphic.
- */
-
- - graphicsPerform:(SEL)aSelector with:arg1 with:arg2;
- /*
- * Sends message aSelector with arguments arg1 and arg2.
- */
-
- - currentGraphic;
- /* over-ride method to use instance of HDraw to get current graphic
- */
-
- - alignAll:sender;
- /*
- * Aliases for -overlay: method. Kept temporarily for
- * backward compatiblity.
- */
-
- - overlay:sender;
- /*
- * Forms an Overlay Group from the selected Graphics.
- */
-
- - unoverlay:sender;
- /*
- * Un-does an Overlay Group.
- */
-
- - alignSize:sender;
- /*
- * Aliases for -overlay: method. Kept temporarily for
- * backward compatiblity.
- */
-
- - alignXRange:sender;
- /* Forces all selected Plots to accept the X range of the first
- * selected plot
- */
-
- - alignYRange:sender;
- /* Forces all selected Plots to accept the Y range of the first
- * selected plot if the first selected Plot is not a 1D plot.
- */
-
- - alignXNumBins:sender;
- /* Forces all selected Plots to accept the number of bins on the X
- * axis of the first selected plot.
- */
-
- - alignYNumBins:sender;
- /* Forces all selected Plots to accept the number of bins on the Y
- * axis of the first selected plot if that plot is not 1D plot.
- */
-
- - copyPSToPasteboard:pboard;
- /* Copies only the PostScript code to the pasteboard
- */
-
- - pasteFromPasteboard:pboard;
- /*
- * Pastes any type available from the specified Pasteboard into the
- * GraphicView.
- * If the type in the Pasteboard is the internal type, then the objects
- * are simply added to the slist and glist. If it is PostScript or TIFF,
- * then an Image object is created using the contents of
- * the Pasteboard. If object is a Plot, then binds the plot by
- * reference to the tuple.
- * Returns a list of the pasted objects (which should be freed
- * by the caller).
- */
- - writePSToStream:(NXStream *)stream;
- /*
- * over-rides method in super class in order to bind displays
- */
-
- - bindDisplays;
- /*
- * Binds all the displays to their ntuples. This method is called
- * opening a document after both the Plot object and ntuple file
- * have been read.
- */
-
- - bindDisplaysInList:list;
- /*
- * Binds any displays contained in Plot objects in the list list
- * to their ntuples. This is a private method used for both
- * opening documents and pasting from the PasteBoard.
- */
- - tupleList;
- /*
- * Returns a List object containing the HTuple objects needed
- * for the Plots in the View.
- */
-
- - replace:oldTuple with:newTuple;
- /*
- * Receiving view replaces oldTuple with newTuple for plots in its view.
- */
-
- - closeTupleFile:(const char *) filename;
- /*
- * Informs each Plot object in the view that references n-tuple
- * in the file filename, that the file is closed.
- */
-
- - openTuple:pasteBoard
- userData:(const char *)args
- error:(char **)errorMsg;
- /*
- * Method for reading ascii n-tuple from pasteboard
- */
-
- - calcDefaultPlotSize:(NXRect *) bbox;
- /*
- * Calculates the default plot size and returns it via
- * the argument.
- */
-
- - prefPanel:sender;
- /*
- * Brings up Preferences Panel
- */
-
- - prefButton:sender;
- /*
- * Responds to either preference Panel button.
- */
-
- - write:(NXTypedStream *)stream;
- /*
- * Writes the HGraphicView object to NXTypedStream stream.
- */
-
- - read:(NXTypedStream *)stream;
- /*
- * Reads the HGraphicView object from the NXTypedStream stream.
- */
-
- @end
-